1. Field of the Invention
The present invention relates to an image processing apparatus which expresses a model by a composite of unit graphics, generates pixel data in a drawing area of a screen coordinate system, performs rendering with respect to a memory, and, when generating an image, generates edge information and performs anti-aliasing and a method of the same.
2. Description of the Related Art
Along with recent improvements of the operating speed in computer systems and the strengthening of drawing functions, “computer graphics (CG)” technology using computer resources to prepare and process graphics and images has been the subject of active research and development and has been put into practical use.
For example, three-dimensional graphics express the optical phenomenon when a three-dimensional object is illuminated by a predetermined light source by a mathematical model, add shading or gradation to the object surface based on this model, and further attach patterns to generate a more realistic and three-dimensional-like two-dimensional high definition image. Such computer graphics have become increasingly used in CAD/CAM in the field of development in science, engineering, and manufacture and other various fields of application.
Three-dimensional graphic processing is generally composed by a “geometry sub-system” positioned as a front end and a “raster sub-system” positioned as a back end.
The “geometry sub-system” means a step of geometric processing of the position, posture, etc. of a three-dimensional object displayed on a display screen. In the geometry sub-system, generally an object is handled as a set of a large number of polygons. The geometric processing such as “coordinate conversion”, “clipping”, and “light source computation” is carried out in unit of polygons.
On the other hand, the “raster sub-system” means a step of painting pixels forming the object. The rasterization is realized by interpolating image parameters of all pixels included inside a polygon based on for example the image parameters found for each vertex of the polygon. The image parameters referred to here include color (drawing color) data expressed by a so-called RGB format, a z-value for expressing distance in a depth direction. etc. Further, in recent high definition three-dimensional graphic processing, also an f (fog) for fostering a sense of perspective and a texture t for expressing the feeling of the material or pattern of the object surface to impart realism are included as image parameters.
Here, the processing for generating a pixel inside a polygon from the vertex information of the polygon is often executed by using a linear interpolation technology referred to as a “digital differential analyzer” (DDA). In the DDA process, the inclination of data to a side direction of a polygon is found from the vertex information, the data on the side is calculated by using this inclination, the inclination of the raster scanning direction (X-direction) is calculated, and the amount of change of the parameter found from this inclination is added to the parameter value of the starting point of the scanning to thereby generate a pixel inside.
Further, in three-dimensional computer graphics, when deciding the color corresponding to each pixel, rendering is performed for computing the color of each pixel and writing the value of this computed color to an address of a display buffer (frame buffer) corresponding to the pixel.
The image generated by such computer graphics is anti-aliased or otherwise processed in order to raise the visual resolution since an aliasing effect of discontinuity of straight lines, polygonal edges, and boundaries of colors occurs. Extraction of the edge information becomes necessary for the anti-aliasing.
Conventionally, edge extraction methods include the method of extracting edges from a generated picture by just filtering, the method of extracting edges by drawing polygons by outlines, etc. Further, the techniques of anti-aliasing include the super sampling method, the method of finding coverage for every pixel, etc.
Summarizing the problems to be solved by the invention, the method of extracting edges by just filtering does not utilize the advantages of the image being made by three-dimensional computer graphics, that is, useful data is generated etc. at the time of generating the image, so a certain degree of edge information is obtained, but edge information accurate enough to be able to be utilized for the anti-aliasing cannot be obtained.
In the method of extracting edges by drawing polygons by outlines, all of the surrounding edges are drawn in units of polygons, so rendering of pixels other than the inherently necessary drawn pixels, such as the surrounding pixels, is necessary. At that part, a drop in the drawing speed is induced. Further, most of the edges of the rendered polygons are not the edges of the drawn object and are overwritten by other polygons, so become useless.
Further, the super sampling method used as an anti-aliasing technique is a method of drawing a large amount of points and then applying a low pass filter (LPF). In this method, if increasing the number of samples, the quality is improved by that extent, but an enormous memory becomes necessary for that amount. Further, when the number of samples is increased, that number has to be rendered, so a serious reduction is caused in the drawing speed as well.
Further, with the method of finding the coverage for every pixel, the size of the memory which become necessary is smaller compared with the technique of super sampling, but the drawing order has a large effect, so correct anti-aliasing cannot be carried out if the drawing order of the polygons is poor and thus a Z-sort technique becomes necessary. Further, even if Z-sorting, there are the problems that the background persistently remains etc. For example, such problems occur at the center of a triangle fan.